package ExecuteEngine;

import Const.Constant;
import parse.DataItem;
import parse.VarcharItem;

public class Element {
	public String relName;
	public String attrName;
	public DataItem value;
	public int length;
	
	public Element(){
	}
	
	public Element(String rel, String attr, DataItem v){
		this.relName = rel;
		this.attrName = attr;
		this.value = v;
		
		if(this.value instanceof VarcharItem)
			length = ((VarcharItem)this.value).value.length();
		else
			length = Constant.INTSIZE;
	}
	
	public void setValue(DataItem v){
		this.value = v;
		if(this.value instanceof VarcharItem)
			length = ((VarcharItem)this.value).value.length();
		else
			length = Constant.INTSIZE;
	}
}
